package com.test.springcloudservice.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.test.springcloudservice.entity.UserEntity;
import com.test.springcloudservice.service.UserService;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Log4j2
@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    UserService userService;

    @GetMapping("queryBySid")
    public UserEntity queryBySid(Long sid) {
        log.debug("服务转发过来了");
        return userService.queryBySid(sid);
    }

    @GetMapping("queryUserList")
    public List<UserEntity> queryUserList() {
        return userService.queryUserList();
    }

    @GetMapping("queryUserPage")
    public Page<UserEntity> queryUserPage() {
        return userService.queryUserPage();
    }
}
